package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.task;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author: YangYu
 * @ClassName: TaskService
 * @Date: Created in 15:13 2021/1/26
 * @Description: 任务
 */
@Slf4j
@Service
public class TaskService extends BaseService {

    /**
     * @Author YangYu
     * @Description 任务-每天任务分页列表
     * @Date Created in 11:44 2021/1/5
     * @Param [jsonParam]
     */

    public RespEntity taskEverydayPagList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","taskEverydayPagList","task");
    }

    /**
     * @Author YangYu
     * @Description 每天任务详情
     * @Date Created in 13:59 2021/1/5
     * @Param [jsonParam]
     */
    public RespEntity taskEverydayDetail(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","taskEverydayDetail","task");
    }

    /**
     * @Author YangYu
     * @Description 任务指派
     * @Date Created in 11:19 2021/1/7
     * @Param [jsonParam]
     */
    public RespEntity assignTasks(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","assignTasks","task");
    }
    /**
     * @Author YangYu
     * @Description 任务检测状态提交
     * @Date Created in 13:59 2021/1/5
     * @Param [jsonParam]
     */
    public RespEntity maintenanceOrMaintainSubmit(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","maintenanceOrMaintainSubmit","task");
    }

    /**
     * @Author YangYu
     * @Description 任务完成提交
     * @Date Created in 11:19 2021/1/7
     * @Param [jsonParam]
     */
    public RespEntity submit(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","submit","task");
    }
    /**
     * @Author YangYu
     * @Description 总的开始检测
     * @Date Created in 11:19 2021/1/7
     * @Param [jsonParam]
     */
    public RespEntity startTesting(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","startTesting","task");
    }
    //下载报告记录新增
    public RespEntity reportAdd(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","reportAdd","task");
    }

    public RespEntity reportPageList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","reportPageList","task");
    }

    public RespEntity reportPageDelete(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","reportPageDelete","task");
    }

    public RespEntity taskComponentState(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"task","taskComponentState","task");
    }
}
